﻿@page "/barcodescanneren"
@attribute [TabItemOption(Text = "Barcode Scan", Icon = "fa fa-barcode")]

<h3>BarcodeReader</h3>

<h4>Barcode/QR code</h4>

<button class="btn btn-primary"
        type="button"
        @onclick="(() => ShowScanBarcode = !ShowScanBarcode)">
    Sacn
</button>
<input type="text" class="form-select form-control" style="min-width: 100px;"
       @bind-value="BarCode"
       placeholder="BarCode" />
@if (ShowScanBarcode)
{

    <BarcodeScanner ScanResult="((e) => { BarCode=e; ShowScanBarcode = !ShowScanBarcode; })"
                    Close="(()=>ShowScanBarcode=!ShowScanBarcode)"
                    ScanBtnTitle="Scan"
                    ResetBtnTitle="Reset"
                    CloseBtnTitle="Close"
                    SelectDeviceBtnTitle="Select Device" />

}
<br />
<br />
<br />
<br />
<div class="table-attr d-none d-md-block">

    <h4>Events</h4>

    <div class="table-container" _bl_79147904-531d-4e31-895f-47eb5e485a57="">

        <div class="table-toolbar">
        </div>

        <div class="table-wrapper">
            <table class="table is-single table-demo">
                <colgroup>
                    <col>
                    <col>
                    <col>
                </colgroup>
                <tbody>
                    <tr>
                        <td><div class="table-cell">ScanResult</div></td>
                        <td><div class="table-cell">Scan result callback method</div></td>
                        <td><div class="table-cell">EventCallback&lt;string&gt;</div></td>
                    </tr>
                    <tr>
                        <td><div class="table-cell">Close</div></td>
                        <td><div class="table-cell">Close scan code callback method</div></td>
                        <td><div class="table-cell">EventCallback</div></td>
                    </tr>
                    <tr>
                        <td><div class="table-cell">ShowScanBarcode</div></td>
                        <td><div class="table-cell">Show scan box</div></td>
                        <td><div class="table-cell">EventCallback</div></td>
                    </tr>
                    <tr>
                        <td><div class="table-cell">ScanBtnTitle</div></td>
                        <td><div class="table-cell">Scan button title</div></td>
                        <td><div class="table-cell">Parameter</div></td>
                    </tr>
                    <tr>
                        <td><div class="table-cell">ResetBtnTitle</div></td>
                        <td><div class="table-cell">Reset button title</div></td>
                        <td><div class="table-cell">Parameter</div></td>
                    </tr>
                    <tr>
                        <td><div class="table-cell">CloseBtnTitle</div></td>
                        <td><div class="table-cell">Close button title</div></td>
                        <td><div class="table-cell">Parameter</div></td>
                    </tr>
                    <tr>
                        <td><div class="table-cell">SelectDeviceBtnTitle</div></td>
                        <td><div class="table-cell">Select device button title</div></td>
                        <td><div class="table-cell">Parameter</div></td>
                    </tr>
                </tbody>
                <thead>
                    <tr>
                        <th><div class="table-cell"><span class="table-text">Parameter</span></div></th>
                        <th><div class="table-cell"><span class="table-text">Description</span></div></th>
                        <th><div class="table-cell"><span class="table-text">Type</span></div></th>
                    </tr>
                </thead>
            </table>
        </div>

        <div class="table-filter">
        </div>

    </div>
</div>

@code{

    /// <summary>
    /// 显示扫码界面
    /// </summary>
    bool ShowScanBarcode { get; set; } = false;

    /// <summary>
    /// 条码
    /// </summary>
    public string? BarCode { get; set; }



} 